<template>
	<div class="main">
		<navTop></navTop>
		<div class="breadBox">
			<el-breadcrumb separator="/">
			  <el-breadcrumb-item :to="{ path: '/examindex' }">考试管理</el-breadcrumb-item>
			  <el-breadcrumb-item :to="{ path: '/examoverview' }">考试概览</el-breadcrumb-item>
			  <el-breadcrumb-item>试题管理</el-breadcrumb-item>
			</el-breadcrumb>
		</div>
		<div class="contentMain">
			<div class="searchlist">
				 <ul>
					 <li @click="tabbarQuestion(1)" :class="tabarnumber==1?'hover':''">客观题设置</li>
					 <li @click="tabbarQuestion(2)" :class="tabarnumber==2?'hover':''">主观题设置</li>
				 </ul>
				 <!-- <router-link to="/questionmanage" active-class="hover">客观题设置</router-link>
				 <router-link to="">主观题设置</router-link> -->
			</div>
			<div class="overviewcontent" v-if="objective">
				<div class="tableContent">
					<div class="scorered">
						满分：{{objtotalScore+subtotalScore+fjttotalScore}} =  {{objtotalScore}}（{{objective.length}}道客观题）+  {{subtotalScore}}（{{subjective.length}}道主观题）包含{{fjttotalScore}}分（{{fjtlist.length}}道附加题）
					</div>
					<block v-if="objective && objective.length > 0">
						<!-- 客观题 -->
						<el-table
							v-if="tabarnumber==1"
							class="custom-table"
						    ref="multipleTable"
						    :data="objective"
						    tooltip-effect="dark"
						    style="width: 100%"
						    @selection-change="handleSelectionChange"
							stripe
							:header-cell-style="{ background: '#D8E4F0', color: '#2A303B',fontWeight:'500' }">
						    <el-table-column
						      type="selection"
						      width="55">
						    </el-table-column>
						    <el-table-column
						      label="试题编号"
							    width="100">
						      <template slot-scope="scope">{{ scope.row.questionNumber }}</template>
						    </el-table-column>
						    <el-table-column
						      label="题型名称"
							    width="105">
								<template slot-scope="scope">{{ scope.row.questionRules?scope.row.questionRules.name:'---' }}</template>
						    </el-table-column>
						    <el-table-column
						      prop="fullMarks"
						      label="满分"
							    width="100">
						    </el-table-column>
							<el-table-column
							  label="标准答案"
							    width="100">
							  <template slot-scope="scope">
								  <ul class="answerlist">
									  <li v-for="item in scope.row.newanswer">{{item}}</li>
								  </ul>
							  </template>
							</el-table-column>
							<el-table-column
							  label="给分规则">
							  <template slot-scope="scope">
							  选择题-{{ scope.row.questionRules.optionCount }}选{{scope.row.questionRules.answerCount}} 对选：{{scope.row.questionRules.yesChoose==1?'满分':scope.row.questionRules.yesChoose==2?'0分':scope.row.questionRules.yesChoose==3?'不扣分':scope.row.questionRules.yesChoose==4?'根据选项给分':scope.row.yesChoose==5?'给一半分':scope.row.questionRules.yesChoose==6?'给一半分(0.5进)':'给一半分(舍去0.5)'}};
							  错选：{{scope.row.questionRules.errorChoose==1?'满分':scope.row.questionRules.errorChoose==2?'0分':scope.row.questionRules.errorChoose==3?'不扣分':scope.row.questionRules.errorChoose==4?'根据选项给分':scope.row.questionRules.errorChoose==5?'给一半分':scope.row.questionRules.errorChoose==6?'给一半分(0.5进)':'给一半分(舍去0.5)'}};
							  漏选：{{scope.row.questionRules.missingSelection==1?'满分':scope.row.questionRules.errorChoose==2?'0分':scope.row.questionRules.missingSelection==3?'不扣分':scope.row.questionRules.missingSelection==4?'根据选项给分':scope.row.questionRules.missingSelection==5?'给一半分':scope.row.questionRules.missingSelection==6?'给一半分(0.5进)':'给一半分(舍去0.5)'}}
							  </template>
							</el-table-column>
							<el-table-column
								fixed="right"
								label="操作"
								align="center"
								width="120">
								<template slot-scope="scope">
									<div style="display: flex;">
										<el-button @click="objeditquestion(scope.row)" type="text" size="small" style="display: flex;align-items: center;"><img src="../../assets/image/school/edit.png" style="width:12px;margin-right:5px;" />编辑</el-button>
										<el-button @click="deleteobject(scope.row.id)" type="text" size="small" style="display: flex;align-items: center;color:#EC555A"><img src="../../assets/image/school/del.png" style="width:12px;margin-right:5px;" />删除</el-button>
									</div>
								</template>
							</el-table-column>
						  </el-table>
					</block>
					  <!-- 主观题 -->
					  <block v-if="subjective && subjective.length > 0">
						  <el-table
							v-if="tabarnumber==2"
							class="custom-table"
							  ref="multipleTable1"
							  :data="subjective"
							  tooltip-effect="dark"
							  style="width: 100%"
							  @selection-change="handleSelectionChange1"
							:row-style="getRowStyle"
							:header-cell-style="{ background: '#D8E4F0', color: '#2A303B',fontWeight:'500' }">
							  <el-table-column
								type="selection"
								width="55">
							  </el-table-column>
							  <el-table-column
								label="试题编号"
								width="100">
								<template slot-scope="scope">{{ scope.row.questionNumber }}</template>
							  </el-table-column>
							  <el-table-column
								label="题型名称">
								<template slot-scope="scope">{{ scope.row.questionRules?scope.row.questionRules.name:'--' }}</template>
							  </el-table-column>
							  <el-table-column
								prop="fullMarks"
								label="满分">
							  </el-table-column>
							  <el-table-column
								prop="stepSize"
								label="步长">
							  </el-table-column>
							  <el-table-column
								prop="reviewCount"
								label="多评轮次">
							  </el-table-column>
							  <el-table-column
								prop="reviewThreshold"
								label="多评阈值">
							  </el-table-column>
							<el-table-column
								fixed="right"
								label="操作"
								align="center"
								width="140">
								<template slot-scope="scope">
									<div style="display: flex;justify-content: center;">
										<el-button v-if="!scope.row.type" @click="editsubjectquestion(scope.row.id)" type="text" size="small" style="display: flex;align-items: center;"><img src="../../assets/image/school/edit.png" style="width:12px;margin-right:5px;" />编辑</el-button>
										<el-button @click="deletesubjectquestion(scope.row.id)" type="text" size="small" style="display: flex;align-items: center;color:#EC555A"><img src="../../assets/image/school/del.png" style="width:12px;margin-right:5px;" />删除</el-button>
									</div>
								</template>
							</el-table-column>
						</el-table>
					</block>
				</div>
			</div>
		</div>
		<div class="examfooter">
			<div class="examFootercontent">
				<div class="totaldata">
					<span>已选<i>{{tabarnumber==1?multipleSelection.length:multipleSelection1.length}}</i>项 / 共{{tabarnumber==1?objective.length:subjective.length}}项</span>
					<em @click="copyExamtab">复用考试</em>
					<em @click="addobjquestiontab" v-if="tabarnumber==1">新增客观题</em>
					<em @click="addsubquestiontab" v-if="tabarnumber==2">新增主观题</em>
					<em @click="exportimportexcel">批量导入</em>
					<em @click="$router.push('/topicmanagement')">题型规则</em>
					<em v-if="tabarnumber==2" @click="muchcommenttab">多评规则</em>
					<em @click="pldelectkgt" v-if="tabarnumber==1">批量删除</em>
					<em @click="pldelectkgt1" v-if="tabarnumber==2">批量删除</em>
				</div>
				<!-- <div>
					<el-pagination
						background
					      @size-change="handleSizeChange"
					      @current-change="handleCurrentChange"
					      :current-page.sync="currentPage3"
					      :page-size="100"
						  :pager-count="5"
					      layout="prev, pager, next, jumper"
					      :total="1000">
					    </el-pagination>
				</div> -->
			</div>
		</div>
		<!-- 新增客观题 -->
		<div class="objsubMain" v-if="addobjquestionIshow">
			<div class="objsubContent">
				<h3>新增客观题</h3>
				<div class="objsubattention">
					<span>注意：</span>
					<p>单选提、判断题、多选题使用英文逗号（ , ）进行分隔。（单选示例：A,B,C 判断示例：T,F,T 多选示例：AB,AC,CD）。</p>
				</div>
				<div class="gundongtiaotable" v-if="objquestionlist.length">
					<el-table
						class="custom-table"
					    ref="multipleTable1"
					    :data="objquestionlist"
					    tooltip-effect="dark"
					    style="width: 100%"
					    @selection-change="handleSelectionChange1"
						:row-style="getRowStyle"
						:header-cell-style="{ background: '#D8E4F0', color: '#2A303B',fontWeight:'500' }">
					    <el-table-column
					      label="题型"
						    width="120">
					      <template slot-scope="scope">
							  <el-select v-model="scope.row.questionRuleId" placeholder="请选择" class="selectbox" :class="{'input-error':txErrors[scope.$index]}">
							      <el-option
							        v-for="item in questionclassifylist"
							        :key="item.id"
							        :label="item.name"
							        :value="item.id">
							      </el-option>
							    </el-select>
						  </template>
					    </el-table-column>
					    <el-table-column
					      label="起止题号">
						  <template slot-scope="scope">
							  <div style="display: flex;align-items: center;">
								  <div style="display:none;">{{errorRows[scope.$index]}}</div>
								  <el-input class="fxwidth" :class="{'input-error':inputErrors[scope.$index]}" v-model="scope.row.questionStartNumber" @input="scope.row.questionStartNumber = onlyzzNumber(scope.row.questionStartNumber)" placeholder="" ></el-input>
								   - 
								  <el-input class="fxwidth" :class="{'input-error':inputErrors[scope.$index]}" v-model="scope.row.questionEndNumber" @input="scope.row.questionEndNumber = onlyzzNumber(scope.row.questionEndNumber)" placeholder=""></el-input>
							  </div>
						  </template>
					    </el-table-column>
						  <el-table-column
							label="满分">
							<template slot-scope="scope">
								<el-input v-model="scope.row.fullMarks " @input="scope.row.fullMarks = onlyNumber(scope.row.fullMarks)" placeholder="" class="fxwidth" :class="{'input-error':scoreErrors[scope.$index]}"></el-input>
							</template>
						  </el-table-column>
					    <el-table-column
					      label="答案">
						  <template slot-scope="scope">
						  	<el-input :class="{ 'input-error': inputErrors[scope.$index]}" v-model="scope.row.answer" placeholder="" class="answerwidth" @input="scope.row.answer = onlyLetters(scope.row.answer)"></el-input>
						  </template>
					    </el-table-column>
						<el-table-column
							fixed="right"
							label="操作"
							align="center"
							width="140">
							<template slot-scope="scope">
								<div style="display: flex;">
									<!-- v-if="scope.$index!=0" -->
									<!-- :disabled="scope.$index!=0?false:true" -->
									<el-button type="text" size="small" @click="deleteobjquestion(scope.$index)" style="display: flex;align-items: center;color:#EC555A"><img src="../../assets/image/school/del.png" style="width:12px;margin-right:5px;" />删除</el-button>
									<el-button @click="addobjsubet(scope.row)" v-if="scope.$index == objquestionlist.length - 1" type="text" size="small" style="display: flex;align-items: center;"><img src="../../assets/image/school/edit.png" style="width:12px;margin-right:5px;" />新增</el-button>
								</div>
							</template>
						</el-table-column>
					  </el-table>
				</div>
				<!-- <div style="color:rgb(236, 85, 90);font-size:14px;padding-top:14px;">
					注意：新增客观题题号与试卷模板客观题题号对比缺少21/23/25，如试题管理与试卷模板题号不配时会造成不能开启扫描状态，如需继续保存请再次点击保存按钮。
				</div> -->
				  <div class="exambutton">
					  <span @click="sureobj">保存</span>
					  <span @click="cancelobj">取消</span>
				  </div>
			</div>
		</div>
		<!-- 编辑客观题 -->
		<div class="addExamMain" v-if="editobjectivequestions">
			<div class="addExamContent">
				<h3 style="padding-bottom:10px;">编辑客观题-{{objdetailinfo.questionNumber}}</h3>
				<div style="color:rgb(236, 85, 90);font-size:14px;padding-bottom :14px;">
					注意：目前该题号与试卷模板客观题题号对比缺少4，如试题管理与试卷模板题号不配时会造成不能开启扫描状态，如需继续保存请再次点击保存按钮。
				</div>
				<block v-if="examinfo.examStage==1">
					<p style="padding-bottom:15px;font-size:14px;">编辑客观题信息</p>
					<ul class="muchcommentlist">
						<li>
							<span style="width:120px;">试题编号：</span>
							<el-input v-model="objdetailinfo.questionNumber"></el-input>
						</li>
						<li>
							<span style="width:97spx;">题型名称：</span>
							<el-select v-model="objdetailinfo.questionRules.id" placeholder="请选择" class="selectbox">
							    <el-option
							      v-for="item in questionclassifylist"
							      :key="item.id"
							      :label="item.name"
							      :value="item.id">
							    </el-option>
							</el-select>
						</li>
						<li>
							<span style="width:120px;">满分：</span>
							<el-input v-model="objdetailinfo.fullMarks"></el-input>
						</li>
						<li style="color:red;" v-if="attentionIshow">
							<i class="el-icon-warning-outline" style="margin-right:5px;"></i>{{attention}}
						</li>
					</ul>
					<p style="padding-bottom:15px;font-size:14px;">设置答案</p>
					<ul class="muchcommentlist">
						<li>
							<span style="width:120px;">标准答案：</span>
							<el-input v-model="objdetailinfo.answer" @input="objdetailinfo.answer = onlyLetters(objdetailinfo.answer)"></el-input>
						</li>
						<li v-if="objdetailinfo.records.length>0" style="align-items:baseline;">
							<span style="width:97px;">修改记录：</span>
							<div>
								<div style="margin-bottom:14px;box-sizing:border-box;width: 400px;height: 34px;border-radius: 10px;border: 1px solid #D8E4F0;font-size:14px;text-align: left;line-height:34px;padding:0 15px;color:#606266" v-for="item in objdetailinfo.records">{{item.answer}}(修改时间：{{item.createdTime}})</div>
							</div>
						</li>
						<li><em style="color:#D54941">修改正确答案后，如已发布成绩请取消重新发布并运算数据分析。</em></li>
						<li style="color:red;" v-if="attentionIshow">
							<i class="el-icon-warning-outline" style="margin-right:5px;"></i>{{attention}}
						</li>
					</ul>	
				</block>
				<block v-else>
					<p style="padding-bottom:15px;font-size:14px;">修改给分规则（单选）</p>
					<ul class="muchcommentlist">
						<li>
							<el-checkbox v-model="isFreeScoreQuestion">送分题</el-checkbox>
						</li>
						<li>
							<el-checkbox v-model="isNoScoreQuestion">0分题</el-checkbox>
						</li>
						<li>
							<el-checkbox v-model="answeristrue"></el-checkbox>
							<span>修正标准答案：</span>
							<el-input class="classobxst" style="width:100px;" v-model="objdetailinfo.answe" @input="objdetailinfo.answe = onlyLetters(objdetailinfo.answe)"></el-input>
						</li>
						<li style="color:red;" v-if="attentionIshow">
							<i class="el-icon-warning-outline" style="margin-right:5px;"></i>{{attention}}
						</li>
					</ul>
				</block>
				<div class="groupbutton">
					<el-button type="primary" @click="editobjectivequestionssurebc">保存</el-button>
					<el-button type="primary" @click="editobjectivequestionsgoback">返回</el-button>
				</div>
			</div>
		</div>
		<!-- 新增主观题  v-if="addsubquestionIshow"-->
		<div class="objsubMain" v-if="addsubquestionIshow">
			<div class="objsubContent">
				<h3>新增主观题</h3>
				<div class="objsubattention">
					<span>注意：</span>
					<p>1.只支持连续的序号进行设置，不连续的请新增一条进行设置。<br>2.小题分设置时，请使用英文逗号分隔（,）。</p>
				</div>
				<div class="boxsetscorll">
					<div class="tablebox">
						<ul class="tableboxtitle">
							<li style="width:150px;">题型</li>
							<li style="width:110px;">起止题号</li>
							<!-- <li style="width:96px;">小题号</li> -->
							<li style="width:70px;">满分</li>
							<!-- <li style="width:60px;">小题分</li> -->
							<li style="width:110px;">步长(给分值)</li>
							<li style="width:80px;">多评轮次</li>
							<li style="width:80px;">多评阈值</li>
							<li style="width:80px;">计入总分</li>
							<li style="width:220px;">操作</li>
						</ul>
						<ul class="tableboxcontent">
							<li v-for="(item,index) in subquestionlist">
								<div class="bigquestion">
									<div class="tabletrtd" style="width:150px;">
										<el-select v-model="item.questionRuleId" placeholder="请选择" class="selectbox">
										    <el-option
										      v-for="item in questionclassifylist"
										      :key="item.id"
										      :label="item.name"
										      :value="item.id">
										    </el-option>
										  </el-select>
									</div>
									<div class="tabletrtd" style="width:110px;">
										<div style="display: flex;align-items: center;">
											  <div style="display:none;">{{errorRows[index]}}</div>
											  <el-input class="fxwidth" v-model="item.questionStartNumber" placeholder=""  @input="item.questionStartNumber = onlyzzNumber(item.questionStartNumber)"></el-input>
											   - 
											  <el-input class="fxwidth"s v-model="item.questionEndNumber" placeholder="" @input="item.questionEndNumber = onlyzzNumber(item.questionEndNumber)"></el-input>
										</div>
									</div>
									<!-- <div class="tabletrtd" style="width:96px;">
										<div style="display: flex;align-items: center;">
											  <div style="display:none;">{{errorRows[index]}}</div>
											  <el-input class="fxwidth" :class="{'input-error':inputErrors[index]}" v-model="item.startQuestionNum" placeholder="" ></el-input>
											   - 
											  <el-input class="fxwidth" :class="{'input-error':inputErrors[index]}" v-model="item.endQuestionNum" placeholder=""></el-input>
										</div>
									</div> -->
									<div class="tabletrtd" style="width:70px;">
										<el-input v-model="item.fullMarks" :class="{'input-error':inputErrors[index]}" placeholder="" class="fxwidth" @input="item.fullMarks = onlyNumber(item.fullMarks)"></el-input>
									</div>
									<!-- <div class="tabletrtd" style="width:60px;">
										<el-input v-model="item.smallscore" placeholder="" class="fxwidth"></el-input>
									</div> -->
									<div class="tabletrtd" style="width:110px;">
										<el-input v-model="item.stepSize" :class="{'input-error':stepSizeerrors[index]}" placeholder="" class="fxwidth" @input="item.stepSize = onlyNumber(item.stepSize)"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<el-input v-model="item.reviewCount" placeholder="" class="fxwidth"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<el-input v-model="item.reviewThreshold" placeholder="" class="fxwidth"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<i :class="item.finalScoring?'yes':'no'" @click="item.finalScoring=!item.finalScoring">{{item.finalScoring?'是':'否'}}</i>
									</div>
									<div class="tabletrtd" style="width:220px;">
										<div style="display: flex;">
											 <!-- :disabled="index!=0?false:true" -->
											<el-button @click="deletesubjectaddnew(index)" type="text" size="small" style="display: flex;align-items: center;color:#EC555A"><img src="../../assets/image/school/del.png" style="width:12px;margin-right:5px;" />删除</el-button>
											<el-button @click="addsmallquestion(index)" type="text" size="small" style="display: flex;align-items: center;"><img src="../../assets/image/school/edit.png" style="width:12px;margin-right:5px;" />新增小题</el-button>
											<el-button @click="addobigquestion(index)" v-if="index == subquestionlist.length - 1" type="text" size="small" style="display: flex;align-items: center;"><img src="../../assets/image/school/edit.png" style="width:12px;margin-right:5px;" />新增题号</el-button>
										</div>
									</div>
								</div>
								<div class="bigquestion" v-for="(itemsmall,childindex) in item.subjectiveItems">
									<div class="tabletrtd" style="width:150px;"></div>
									<!-- <div class="tabletrtd" style="width:96px;">
									</div> -->
									<div class="tabletrtd" style="width:110px;">
										<div style="display: flex;align-items: center;">
											  <div style="display:none;">{{errorRows[index]}}</div>
											  <el-input class="fxwidth" v-model="itemsmall.questionNumber" placeholder="" ></el-input>
										</div>
									</div>
									<!-- <div class="tabletrtd" style="width:60px;">
										<el-input v-model="itemsmall.score" placeholder="" class="fxwidth"></el-input>
									</div> -->
									<div class="tabletrtd" style="width:70px;">
										<el-input v-model="itemsmall.fullMarks" :class="{'input-error':inputErrors[index]}" placeholder="" class="fxwidth" @input="itemsmall.smallQuestionScore = onlyzzNumber(itemsmall.smallQuestionScore)"></el-input>
									</div>
									<div class="tabletrtd" style="width:110px;">
										<el-input v-model="itemsmall.stepSize" placeholder="" class="fxwidth" @input="itemsmall.stepSize = onlyNumber(itemsmall.stepSize)"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<el-input v-model="itemsmall.reviewCount" placeholder="" class="fxwidth"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<el-input v-model="itemsmall.reviewThreshold" placeholder="" class="fxwidth"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<i :class="itemsmall.finalScoring?'yes':'no'" @click="itemsmall.finalScoring=!itemsmall.finalScoring">{{itemsmall.finalScoring?'是':'否'}}</i>
									</div>
									<div class="tabletrtd" style="width:220px;">
										<div style="display: flex;">
											<el-button @click="deletesubjectaddnewsmall(index,childindex)" type="text" size="small" style="display: flex;align-items: center;color:#EC555A"><img src="../../assets/image/school/del.png" style="width:12px;margin-right:5px;" />删除</el-button>
										</div>
									</div>
								</div>
							</li>
						</ul>
					</div>
				</div>
				<!-- <div style="color:rgb(236, 85, 90);font-size:14px;padding-top:14px;">
					注意：新增主观题题号与试卷模板客观题题号对比缺少21/23/25，如试题管理与试卷模板题号不配时会造成不能开启扫描状态，如需继续保存请再次点击保存按钮。
				</div> -->
				<div class="groupbutton">
					<el-button type="primary" @click="addquestionsurebc">保存</el-button>
					<el-button type="primary" @click="addquestiongoback">返回</el-button>
				</div>
			</div>
		</div>
			<!-- 多评规则 -->
			<div class="addExamMain" v-if="muchcommentIshow">
				<div class="addExamContent">
					<h3 style="padding-bottom:10px;">多评轮次规则</h3>
					<ul class="muchcommentlist">
						<li>
							<span style="width:71px;">复用考试：</span>
							<div class="inputBox">
								<el-select v-model="addinfo.gradeId" placeholder="请选择复用考试">
								  <el-option
									v-for="item in gradelist"
									:key="item"
									:label="item"
									:value="item">
								  </el-option>
								</el-select>
							</div>
						</li>
						<li>
							<p style="font-size: 14px;color: #EC555A;padding-bottom:24px">注：进入最终轮多评后平均分依然超过阈值，则取后三评中前2高分数进行平均。</p>
						</li>
						<li>仲裁规则</li>
						<li class="infosetcontentfont"><el-checkbox v-model="infoSet"></el-checkbox> 多评中有0分和非0分时，直接进入仲裁</li>
						<li class="infosetcontentfont"><el-checkbox v-model="studentNumber"></el-checkbox> 多评中有满分和非满分时，直接进入仲裁</li>
						<li class="infosetcontentfont"><el-checkbox v-model="teacherNumber"></el-checkbox> 多评中平均分超出阈值2倍时，直接进入仲裁</li>
						<li style="color:red;" v-if="attentionIshow">
							<i class="el-icon-warning-outline" style="margin-right:5px;"></i>{{attention}}
						</li>
					</ul>
					<div class="groupbutton">
						<el-button type="primary" @click="surebc">保存</el-button>
						<el-button type="primary" @click="goback">返回</el-button>
					</div>
				</div>
			</div>
			<!-- 复用考试 -->
			<div class="addExamMain" v-if="copyexamIshow">
				<div class="addExamContent">
					<h3 style="padding-bottom:10px;">请选择复用模板科目</h3>
					<ul class="tabletabcopy">
						<li class="hover">过往考试</li>
						<li>组件模板</li>
						<li>模板代码</li>
					</ul> 
					<div class="copyexamcontent">
						<ul>
							<li v-for="item in copyexamsuject" @click="copyexamSubject(item)">
								<div>{{item.examName}}<span>{{item.examDate}}创建</span></div>
								<p><em v-for="sub in item.courses">{{sub.courName}}</em></p>
							</li>
						</ul>
					</div>
					<div class="groupbutton">
						<el-button type="" @click="gobackclose">关闭</el-button>
					</div>
				</div>
			</div>
			<!-- 批量导入 -->
			<div class="addExamMain" v-if="batcImportIshow">
				<div class="addExamContent">
					<h3>批量上传{{tabarnumber==1?'客观题':'主观题'}}</h3>
					<div class="uploadbox">
						<el-upload
						  class="upload-demo"
						  drag
						  action="https://jsonplaceholder.typicode.com/posts/">
						  <i class="el-icon-upload"></i>
						  <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
						  <div class="el-upload__tip" slot="tip">每次导入仅能上传一个文件</div>
						</el-upload>
						<a href="#" class="downmoban">下载模板</a>
					</div>
					<div class="groupbutton">
						<el-button type="primary" @click="batcImportsure">确认</el-button>
						<el-button type="primary" @click="batcImportgoback">取消</el-button>
					</div>
				</div>
			</div>
			<!-- 编辑主观题 -->
			<div class="objsubMain" v-if="editsubquestionIshow">
				<div class="objsubContent">
					<h3>编辑主观题-{{editsubjectquestionlist.questionNumber}}</h3>
					<div class="objsubattention">
						<span>注意：</span>
						<p>步长可设置制定分值给分，请用英文逗号分隔（,）。</p>
					</div>
					<div class="tablebox">
						<ul class="tableboxtitle">
							<li style="width:150px;">题型</li>
							<li style="width:110px;">起止题号</li>
							<!-- <li style="width:96px;">小题号</li> -->
							<li style="width:70px;">满分</li>
							<!-- <li style="width:60px;">小题分</li> -->
							<li style="width:110px;">步长(给分值)</li>
							<li style="width:80px;">多评轮次</li>
							<li style="width:80px;">多评阈值</li>
							<li style="width:80px;">计入总分</li>
							<li style="width:220px;">操作</li>
						</ul>
						<ul class="tableboxcontent">
							<li v-for="(item,index) in subquestionlist">
								<div class="bigquestion">
									<div class="tabletrtd" style="width:150px;">
										<el-select v-model="editsubjectquestionlist.questionRuleId" placeholder="请选择" class="selectbox">
										    <el-option
										      v-for="item in questionclassifylist"
										      :key="item.id"
										      :label="item.name"
										      :value="item.id">
										    </el-option>
										  </el-select>
									</div>
									<div class="tabletrtd" style="width:110px;">
										<div style="display: flex;align-items: center;">
											  <div style="display:none;">{{errorRows[index]}}</div>
											  <el-input class="fxwidth" v-model="editsubjectquestionlist.questionNumber" placeholder=""  @input="editsubjectquestionlist.questionNumber = onlyzzNumber(editsubjectquestionlist.questionNumber)"></el-input>
										</div>
									</div>
									<div class="tabletrtd" style="width:70px;">
										<el-input v-model="editsubjectquestionlist.fullMarks" :class="{'input-error':inputErrors[index]}" placeholder="" class="fxwidth" @input="editsubjectquestionlist.fullMarks = onlyNumber(editsubjectquestionlist.fullMarks)"></el-input>
									</div>
									<div class="tabletrtd" style="width:110px;">
										<el-input v-model="editsubjectquestionlist.stepSize" :class="{'input-error':stepSizeerrors[index]}" placeholder="" class="fxwidth" @input="editsubjectquestionlist.stepSize = onlyNumber(editsubjectquestionlist.stepSize)"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<el-input v-model="editsubjectquestionlist.reviewCount" placeholder="" class="fxwidth"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<el-input v-model="editsubjectquestionlist.reviewThreshold" placeholder="" class="fxwidth"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<i :class="item.finalScoring?'yes':'no'" @click="item.finalScoring=!item.finalScoring">{{item.finalScoring?'是':'否'}}</i>
									</div>
									<div class="tabletrtd" style="width:220px;">
										<div style="display: flex;">
											<el-button type="text" size="small"  :disabled="index!=0?false:true" style="display: flex;align-items: center;color:#EC555A"><img src="../../assets/image/school/del.png" style="width:12px;margin-right:5px;" />删除</el-button>
											<el-button @click="addsmallquestion1(index)" type="text" size="small" style="display: flex;align-items: center;"><img src="../../assets/image/school/edit.png" style="width:12px;margin-right:5px;" />新增小题</el-button>
										</div>
									</div>
								</div>
								<div class="bigquestion" v-for="itemsmall in editsubjectquestionlist.subjectiveItems">
									<div class="tabletrtd" style="width:150px;"></div>
									<!-- <div class="tabletrtd" style="width:96px;">
									</div> -->
									<div class="tabletrtd" style="width:110px;">
										<div style="display: flex;align-items: center;">
											  <div style="display:none;">{{errorRows[index]}}</div>
											  <el-input class="fxwidth" v-model="itemsmall.questionNumber" placeholder="" ></el-input>
										</div>
									</div>
									<!-- <div class="tabletrtd" style="width:60px;">
										<el-input v-model="itemsmall.score" placeholder="" class="fxwidth"></el-input>
									</div> -->
									<div class="tabletrtd" style="width:70px;">
										<el-input v-model="itemsmall.fullMarks" :class="{'input-error':inputErrors[index]}" placeholder="" class="fxwidth" @input="itemsmall.smallQuestionScore = onlyzzNumber(itemsmall.smallQuestionScore)"></el-input>
									</div>
									<div class="tabletrtd" style="width:110px;">
										<el-input v-model="itemsmall.stepSize" placeholder="" class="fxwidth" @input="itemsmall.stepSize = onlyNumber(itemsmall.stepSize)"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<el-input v-model="itemsmall.reviewCount" placeholder="" class="fxwidth"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<el-input v-model="itemsmall.reviewThreshold" placeholder="" class="fxwidth"></el-input>
									</div>
									<div class="tabletrtd" style="width:80px;">
										<i :class="itemsmall.finalScoring?'yes':'no'" @click="itemsmall.finalScoring=!itemsmall.finalScoring">{{itemsmall.finalScoring?'是':'否'}}</i>
									</div>
									<div class="tabletrtd" style="width:220px;">
										<div style="display: flex;">
											<el-button type="text" size="small" style="display: flex;align-items: center;color:#EC555A"><img src="../../assets/image/school/del.png" style="width:12px;margin-right:5px;" />删除</el-button>
										</div>
									</div>
								</div>
							</li>
						</ul>
					</div>
					<!-- <div style="color:rgb(236, 85, 90);font-size:14px;padding-top:14px;">
						注意：新增主观题题号与试卷模板客观题题号对比缺少214，如试题管理与试卷模板题号不配时会造成不能开启扫描状态，如需继续保存请再次点击保存按钮。
					</div> -->
					<div class="groupbutton">
						<el-button type="primary" @click="editquestionsurebc">保存</el-button>
						<el-button type="primary" @click="editquestiongoback">返回</el-button>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import navTop from "../../components/school/head.vue"
	import copyExam from '../../components/school/copyexam.vue'
	import empty from '../../components/school/empty.vue'
	import { get, post, del, put } from '../../request/api.js'
	import GBK from 'gbk.js';
	export default{
		data(){
			return{
				examinfo:{},
				addExamIshow:false,	
				objective: [],
				subjective:[],
				multipleSelection: [],
				multipleSelection1: [],
				questionlist:[],
				currentPage3: 4,
				tabarnumber:1,
				objquestionlist:[
					{
						id:0,
						questionStartNumber:'',
						questionEndNumber:'',
						fullMarks:'',
						answer:'',
						questionRuleId:null
					},
				],
				errorRows: [], // 用于存储有错误的行索引
				inputErrors: {},
				scoreErrors:{},
				txErrors:{},
				addobjquestionIshow:false,
				addsubquestionIshow:false,
				editsubquestionIshow:false,
				subquestionlist:[
				  {
				    id: 0,
				    questionNumber:'',
				    fullMarks: '',
				    stepSize: '',
				    reviewCount: '',
				    reviewThreshold: '',
				    finalScoring: true,
				    questionRuleId:null,
				    subjectiveItems: []
				  } 
				],
				addinfo:{
					gradeId:'',
					examTime:'',
					name:'',
					subjectList:[],
					fullMark:'',
					selectScoreType:false?0:1,
					n4Id:undefined,
					n5Id:undefined
				},
				infoSet:true,
				studentNumber:true,
				teacherNumber:true,
				gradelist:['高一','高二','高三'],
				attentionIshow:false,
				muchcommentIshow:false,
				copyexamIshow:false,
				batcImportIshow:false,
				questionclassifylist:[],
				editobjectivequestions:false,
				objeditexam:{
					id: 0,
					questionStartNumber: 0,
					questionEndNumber: 0,
					fullMarks: 0,
					answer: "",
					questionRuleId: 0
				},
				objdetailinfo:{},
				answeristrue:false,
				isFreeScoreQuestion:false,
				isNoScoreQuestion:false,
				copyexamsuject:[],
				stepSizeerrors:{},
				newsubjectives:[],
				fjtlist:[],
				editsubjectquestionlist:[],
				objectnumber:'',
				isSubmitting: false, // 添加提交状态标识
				        submitTimer: null   ,// 添加定时器
						 editAttempts: 0,
						        maxEditAttempts: 3,
						        retryDelay: 1000,
								 addAttempts: 0,
								        maxAddAttempts: 3
			}
		},
		mounted() {
			this.examinfo=JSON.parse(sessionStorage.getItem('examInfo'))
			// let arr1 = [{name:'fuzi',items:[{name:'1',id:1]},{name:'1',id:1},{name:'fuzi1',items:[{name:'2',id:2}]},{name:'2',id:2}]
			this.objquestiontablist()
			this.objquestionlist[0].examCourseId = Number(this.examinfo.id)
		},
		methods:{
			// 格式化输入值
			    formatInputValue(value) {
			        return value === 0 ? '' : value;
			    },
			onlyLetters(value) {
			  return value.replace(/[^a-zA-Z,]/g, '');
			},
			onlyNumber(value) {
			  return value.replace(/[^0-9.]/g, '');
			},
			onlyzzNumber(value) {
			  return value.replace(/[^0-9]/g, '');
			},
			// 获取客观题列表
			 // 安全地处理数据的辅助方法
			    safelyProcessData(data) {
			        if (!data || !Array.isArray(data)) {
			            return [];
			        }
			        return data.filter(item => item !== null && item !== undefined);
			    },
			
			    // 在主方法中使用
			    objquestiontablist() {
			        get('/objective/list', { examcourseId: Number(this.examinfo.id) })
			            .then(res => {
			                if (res.code == 200) {
			                    // 处理客观题
			                    const objectives = this.safelyProcessData(res.data.objectives);
			                    this.objective = objectives.map(item => ({
			                        ...item,
			                        newanswer: item.answer ? item.answer.split(',').map(answer => answer.trim()) : []
			                    }));
			
			                    // 处理主观题
			                    const subjectives = this.safelyProcessData(res.data.subjectives);
			                    let newarry = [];
			
			                    subjectives.forEach(item => {
			                        newarry.push({ ...item });
			                        
			                        if (item.subjectiveItems) {
			                            const safeItems = this.safelyProcessData(item.subjectiveItems);
			                            safeItems.forEach(subItem => {
			                                newarry.push({ ...subItem, type: '小题' });
			                            });
			                        }
			                    });
			
			                    this.subjective = newarry;
			                    this.newsubjectives = subjectives;
			                    this.fjtlist = subjectives.filter(item => 
			                        item.questionRules && item.questionRules.name === '附加题'
			                    );
			                } else {
			                    this.resetData();
			                }
			            })
			            .catch(() => {
			                this.resetData();
			            });
			    },
			    // 重置数据的方法
			    resetData() {
			        this.objective = [];
			        this.subjective = [];
			        this.newsubjectives = [];
			        this.fjtlist = [];
			    },
			
			//获取题型列表
			questionclassify(){
				get('/questionrules/list')
				.then(res=>{
					if(res.code==200){
						if(this.tabarnumber==1){
							this.questionclassifylist = res.data.filter(item=>item.questionType==2)
						}else{
							this.questionclassifylist = res.data.filter(item=>item.questionType==1)
						}
						// this.questionclassifylist = res.data
					}else{
						this.$message.error(res.message); 
					}
				})
				.catch(error=>{
					this.$message.error(error.message); 
				})
			},
			copyExamtab(){
				this.copyexamIshow=true
				this.examcourselisttab()
			},
			tabbarQuestion(number){
				this.tabarnumber = number
			},
			getRowStyle({ rowIndex }) {
			    return {
			      backgroundColor: rowIndex % 2 === 1 ? '#FAFAFB' : '#ffffff'
			    };
			  },
			// 新建考试
			addExam(){
				this.addExamIshow = true
			},
			addexamclick(data){
				this.addExamIshow=data
			},
			handleSizeChange(val) {
				console.log(`每页 ${val} 条`);
			},
			handleCurrentChange(val) {
				console.log(`当前页: ${val}`);
			},
			// 客观题全选
			handleSelectionChange(val) {
				this.multipleSelection = val;
			},
			// 主观题全选
			handleSelectionChange1(val) {
				this.multipleSelection1 = val;
			},
			// 新增客观题
			addobjsubet(){
				let params = {
						id:0,
						examCourseId:Number(this.examinfo.id),
						questionStartNumber:'',
						questionEndNumber:'',
						fullMarks:'',
						answer:'',
						questionRuleId:null
				}
				this.objquestionlist.push(params)
			},
			// 新增客观题
			addobjquestiontab(){
				this.questionclassify()
				this.addobjquestionIshow= true
			},
			// 保存客观题
			 async sureobj() {
				// 如果正在提交中，直接返回
				if (this.isSubmitting) {
					return;
				}
				try {
					// 设置提交状态
					this.isSubmitting = true;
					// 清空错误状态
					this.errorRows = [];
					this.txErrors = [];
					this.scoreErrors = [];
					this.inputErrors = [];
		
					// 验证所有数据
					let hasError = false;
					for (let index = 0; index < this.objquestionlist.length; index++) {
						const item = this.objquestionlist[index];
						// 验证题型
						if (item.questionRuleId == null) {
							this.txErrors[index] = true;
							hasError = true;
							continue;
						}
						this.txErrors[index] = false;
						// 验证分数
						if (item.fullMarks == 0) {
							this.scoreErrors[index] = true;
							hasError = true;
							continue;
						}
						this.scoreErrors[index] = false;
						// 验证答案数量
						// const questionCount = item.questionEndNumber - item.questionStartNumber + 1;
						// const answerCount = item.answer ? item.answer.split(',').length : 0;
						// if (answerCount !== questionCount) {
						// 	this.errorRows.push(index);
						// 	this.inputErrors[index] = true;
						// 	hasError = true;
						// 	continue;
						// }
						// this.inputErrors[index] = false;
					}
					// 如果有错误，显示提示并返回
					if (hasError) {
						this.$message.warning('请检查填写的信息是否完整');
						return;
					}
					// 转换数据
					const transformedData = this.objquestionlist.map(item => ({
						...item,
						examCourseId:parseInt(this.examinfo.id),
						questionStartNumber: parseInt(item.questionStartNumber, 10),
						questionEndNumber: parseInt(item.questionEndNumber, 10),
						fullMarks: parseFloat(item.fullMarks, 10),
						answer: item.answer.toUpperCase(),
					}));
					//console.info(transformedData)
					// return false
					// 发送请求
					const res = await post('/objective/add', transformedData);
					if (res.code == 200) {
						this.$message({
							message: '保存成功',
							type: 'success'
						});
						// 重置状态
						this.addobjquestionIshow = false;
						await this.objquestiontablist();
						this.objquestionlist = [{
							id: 0,
							questionStartNumber:'',
							questionEndNumber: '',
							fullMarks:'',
							answer: '',
							questionRuleId: null
						}];
					} else {
						this.$message({
							message:res.message,
							type: 'error'
						});
					}
				} catch (error) {
					this.$message({
						message:error.message || '保存失败',
						type: 'error'
					});
				} finally {
					//console.info('ddddddsssssdd')
					// 设置延时，防止快速重复点击
					this.isSubmitting = false;
					// 使用 Promise 确保延时执行
					await new Promise(resolve => setTimeout(resolve, 1000));
				}
			},
			// 获取客观题编辑
			objdetail(id){
				get('/objective/details',{objectiveId:id})
				.then(res=>{
					if(res.code==200){
						this.objdetailinfo = res.data
					}else{
						this.$message.error(res.message); 
					}
				})
				.catch(error=>{
					this.$message.error(error.message); 
				})
			},
			//删除客观题
			deleteobjquestion(num){
				//console.info('删除客观题',num)
				if(num==0){
					//console.info('ddddd')
					this.objquestionlist = [{
						id: 0,
						questionStartNumber:'',
						questionEndNumber: '',
						fullMarks:'',
						answer: '',
						questionRuleId: null
					}]
				}else{
					//console.info('ssss')
					this.objquestionlist.splice(num, 1);
				}
				
			},
			//编辑客观题
			objeditquestion(con){
				this.editobjectivequestions = true
				this.objdetail(con.id)
				this.questionclassify()
				//console.info(con)
				// this.objeditexam
			},
			//保存编辑客观题
			async editobjectivequestionssurebc() {
			        if (this.editAttempts >= this.maxEditAttempts) {
			            this.$message.warning('操作过于频繁，请稍后再试');
			            setTimeout(() => {
			                this.editAttempts = 0;
			            }, this.retryDelay * 5);
			            return;
			        }
			
			        this.editAttempts++;
			
			        try {
			            await this.performEdit();
			        } finally {
			            setTimeout(() => {
			                this.editAttempts = Math.max(0, this.editAttempts - 1);
			            }, this.retryDelay);
			        }
			    },
			
			    async performEdit() {
					this.editobjectivequestions = false
					this.objeditexam.examCourseId=Number(this.examinfo.id)
					this.objeditexam.id = this.objdetailinfo.id
					this.objeditexam.questionNumber=this.objdetailinfo.questionNumber
					this.objeditexam.fullMarks = this.objdetailinfo.fullMarks
					this.objeditexam.answer =this.objdetailinfo.answer.toUpperCase()
					this.objeditexam.questionRuleId = this.objdetailinfo.questionRules.id
					this.objeditexam.isFreeScoreQuestion = this.isFreeScoreQuestion
					this.objeditexam.isNoScoreQuestion = this.isNoScoreQuestion
					//console.info(this.objeditexam)
					await post('/objective/update',this.objeditexam)
					.then(res=>{
						if(res.code==200){
							this.$message.success('编辑成功');
							this.objquestiontablist()
						}else{
							this.$message.error(res.message); 
						}
					})
					.catch(error=>{
						this.$message.error(error.message); 
					})
			        // 原有的编辑逻辑
			    },
			// editobjectivequestionssurebc(){
				
			// },
			//返回编辑客观题
			editobjectivequestionsgoback(){
				this.editobjectivequestions = false
			},
			//取消新增客观题
			cancelobj(){
				this.addobjquestionIshow= false
				this.objquestionlist=[
					{
						id:0,
						questionStartNumber:'',
						questionEndNumber:'',
						fullMarks:'',
						answer:'',
						questionRuleId:null
					},
				]
			},
			//新增主观题
			addsubquestiontab(){
				this.questionclassify()
				this.addsubquestionIshow= true
			},
			// 保存主观题
			suresub(){
				this.addsubquestionIshow= false
			},
			// 取消主观题
			cancelsub(){
				this.addsubquestionIshow= false
				this.subquestionlist=[
				  {
				    id: 0,
				    questionNumber:'',
				    fullMarks:'',
				    stepSize: '',
				    reviewCount: '',
				    reviewThreshold: '',
				    finalScoring: true,
				    questionRuleId:null,
				    subjectiveItems: []
				  } 
				]
			},
			surebc(){
				this.muchcommentIshow=false
			},
			goback(){
				this.muchcommentIshow=false
			},
			muchcommenttab(){
				this.muchcommentIshow=true
			},
			// 复用考试
			gobackclose(){
				this.copyexamIshow = false
			},
			//批量导入
			exportimportexcel(){
				this.batcImportIshow = true
			},
			batcImportsure(){
				this.batcImportIshow = false
			},
			batcImportgoback(){
				this.batcImportIshow = false
			},
			// 添加小题
			addsmallquestion(index){
				let smallquestion = {
				        id: 0,
				        subjectiveId: 0,
				        questionNumber:'',
				        fullMarks:'',
				        stepSize:'',
				        reviewCount: '',
				        finalScoring: true,
				        reviewThreshold: ''
				}
				//console.info(this.subquestionlist[index])
				this.subquestionlist[index].subjectiveItems.push(smallquestion)
			},
			//添加大题
			addobigquestion(index){
					let bigquestion = {
				    id: 0,
				    questionNumber:'',
				    fullMarks:'',
				    stepSize:'',
				    reviewCount:'',
				    reviewThreshold:'',
				    finalScoring: true,
				    questionRuleId:null,
				    subjectiveItems: []
				  } 
				this.subquestionlist.push(bigquestion)
			},
			async addquestionsurebc() {
				if (this.addAttempts >= this.maxAddAttempts) {
					this.$message.warning('操作过于频繁，请稍后再试');
					setTimeout(() => {
						this.addAttempts = 0;
					}, 5000);
					return;
				}
				this.addAttempts++;
				try {
					await this.performAdd();
				} finally {
					setTimeout(() => {
						this.addAttempts = Math.max(0, this.addAttempts - 1);
					}, 1000);
				}
			},
			 // 安全的整数转换函数
			    safeParseInt(value, defaultValue = 0) {
			        const parsed = parseInt(value, 10);
			        return isNaN(parsed) ? defaultValue : parsed;
			    },
			
			    // 转换小题数据
			    transformSubjectiveItem(subItem) {
			        return {
			            id: this.safeParseInt(subItem.id),
			            subjectiveId: this.safeParseInt(subItem.subjectiveId),
			            questionNumber: this.safeParseInt(subItem.questionNumber),
			            fullMarks: this.safeParseInt(subItem.fullMarks),
			            stepSize:this.safeParseInt(subItem.stepSize),
			            reviewCount: this.safeParseInt(subItem.reviewCount),
			            finalScoring: subItem.finalScoring,
			            reviewThreshold: this.safeParseInt(subItem.reviewThreshold)
			        };
			    },
			performAdd(){
				this.stepSizeerrors = []; // 重置错误状态
				this.inputErrors = []; // 重置错误状态
				this.subquestionlist.forEach((item,index) => {
				  // 验证 stepSize 不超过 fullMarks
				  if (item.stepSize && parseInt(item.stepSize, 10) > item.fullMarks) {
				    console.error(`stepSize 不能超过 fullMarks for item with id: ${item.id}`);
					// this.stepSizeerrors[index] = true;
					this.$set(this.stepSizeerrors, index, true);
				  }
				  // 计算 items 中 smallQuestionScore 的总和
					if(item.subjectiveItems.length>0){
						// const totalScore = item.items.reduce((acc, smallItem) => acc + smallItem.smallQuestionScore, 0);
						const totalScore = item.subjectiveItems.reduce((acc, smallItem) => {
						  const score = Number(smallItem.fullMarks) || 0; // 确保转换为数字，如果失败则为 0
						  return acc + score;
						}, 0);
						//console.info(totalScore+'--'+item.fullMarks)
						if (totalScore != item.fullMarks) {
						  console.error(`smallQuestionScore 的总和必须等于 fullMarks for item with id: ${item.id}`);
						   // this.inputErrors[index] = true;
						   this.$set(this.inputErrors, index, true);
						}
					}
				});
				 const hasErrors = this.stepSizeerrors.some(err => err) || this.inputErrors.some(err => err);
				 if (!hasErrors) {
					 const transformedData = this.subquestionlist.map(item => ({
					   ...item,
					   examCourseId:Number(this.examinfo.id),
					   questionStartNumber: parseInt(item.questionStartNumber, 10),
					   questionEndNumber: parseInt(item.questionEndNumber, 10),
					   fullMarks: parseFloat(item.fullMarks, 10),
					   reviewCount:parseInt(item.reviewCount, 10) || 1,
					   reviewThreshold:parseFloat(item.reviewThreshold, 10) || 0,
					   stepSize:parseFloat(item.stepSize, 10) || 1,
					   questionNumber:0,
					   subjectiveItems: Array.isArray(item.subjectiveItems) 
						   ? item.subjectiveItems.map(subItem => this.transformSubjectiveItem(subItem))
						   : []
					 }));
					 //console.info(transformedData)
					 post('/subjective/add',transformedData)
					 .then(res=>{
					 	if(res.code==200){
					 		this.$message({
					 			type: 'success',
					 			message: '添加成功!'
					 		});
					 		this.objquestiontablist()
							this.addsubquestionIshow = false
							this.subquestionlist=[
							  {
							    id: 0,
							    questionNumber: '',
							    fullMarks: '',
							    stepSize:'',
							    reviewCount: '',
							    reviewThreshold: '',
							    finalScoring: true,
							    questionRuleId:null,
							    subjectiveItems: []
							  } 
							]
					 	}else{
					 		this.$message({
					 			type: 'error',
					 			message: res.message
					 		});
					 	}
					 })
					 .catch(error=>{
					 	this.$message({
					 		type: 'error',
					 		message:  error.message
					 	});
					 })
				 }
			},
			addquestiongoback(){
				this.addsubquestionIshow = false
				this.subquestionlist=[
				  {
				    id: 0,
				    questionNumber: '',
				    fullMarks: '',
				    stepSize:'',
				    reviewCount: '',
				    reviewThreshold: '',
				    finalScoring: true,
				    questionRuleId:null,
				    subjectiveItems: []
				  } 
				]
			},
			//删除单个客观题
			deleteobject(id){
				this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
					  confirmButtonText: '确定',
					  cancelButtonText: '取消',
					  type: 'warning'
				}).then(() => {
					let ids=[id]
					del('/objective/delete',ids)
					.then(res=>{
						if(res.code==200){
							this.$message({
								type: 'success',
								message: '删除成功!'
							});
							this.objquestiontablist()
						}else{
							this.$message({
								type: 'error',
								message: res.message
							});
						}
					})
					.catch(error=>{
						this.$message({
							type: 'error',
							message: error.message
						});
					})
				}).catch(() => {
					  this.$message({
						type: 'info',
						message: '已取消删除'
					  });          
				});
			},
			//批量删除客观题
			pldelectkgt(){
				let ids=this.multipleSelection.map(item => item.id)
				this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
					  confirmButtonText: '确定',
					  cancelButtonText: '取消',
					  type: 'warning'
				}).then(() => {
					del('/objective/delete',ids)
					.then(res=>{
						if(res.code==200){
							this.$message({
								type: 'success',
								message: '删除成功!'
							});
							 this.$nextTick(() => {
							        setTimeout(() => {
							            this.objquestiontablist();
							        }, 300);
							    });
						}else{
							this.$message({
								type: 'error',
								message: res.message
							});
						}
					})
					.catch(error=>{
						this.$message({
							type: 'error',
							message: error.message
						});
					})
				}).catch(() => {
					  this.$message({
						type: 'info',
						message: '已取消删除'
					  });          
				});
			},
			//批量删除主观题
			pldelectkgt1(){
				let ids=this.multipleSelection1.map(item => item.id)
				this.delectsubject(ids)
			},
			// 请选择复用模板科目
			examcourselisttab(){
				get('/exam/examcourselist',{courseId:this.examinfo.coursesId})
				.then(res=>{
					if(res.code==200){
						// this.$message.success('编辑成功');
						// this.objquestiontablist()
						this.copyexamsuject = res.data
					}else{
						this.$message.error(res.message); 
					}
				})
				.catch(error=>{
					this.$message.error(error.message); 
				})
			},
			// 复用考试学科
			copyexamSubject(con){
				// 客观题复用
				if(this.tabarnumber==1){
					let obj = {
						examId:this.examinfo.examinationId,
						copyExamId:con.examId,
						courseId:con.courses[0].courId
					}
					post('/objective/copy',obj)
					.then(res=>{
						if(res.code==200){
							this.$message.success('复用成功')
							this.copyexamIshow = false
							this.objquestiontablist()
						}else{
							this.$message.error(res.message); 
						}
					})
					.catch(error=>{
						this.$message.error(error.message); 
					})
				}else{
					// 主观题复用
					let obj = {
						examId:this.examinfo.examinationId,
						copyExamId:con.examId,
						courseId:con.courses[0].courId
					}
					post('/subjective/copy',obj)
					.then(res=>{
						if(res.code==200){
							this.$message.success('复用成功')
							this.copyexamIshow = false
							this.objquestiontablist()
						}else{
							this.$message.error(res.message); 
						}
					})
					.catch(error=>{
						this.$message.error(error.message); 
					})
				}
			},
			// 删除主观题封装
			delectsubject(ids){
				this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
					  confirmButtonText: '确定',
					  cancelButtonText: '取消',
					  type: 'warning'
				}).then(() => {
					del('/subjective/delete',ids)
					.then(res=>{
						if(res.code==200){
							this.$message({
								type: 'success',
								message: '删除成功!'
							});
							this.objquestiontablist()
						}else{
							this.$message({
								type: 'error',
								message: res.message
							});
						}
					})
					.catch(error=>{
						this.$message({
							type: 'error',
							message: error.message
						});
					})
				}).catch(() => {
					  this.$message({
						type: 'info',
						message: '已取消删除'
					  });          
				});
			},
			// 删除主观题
			deletesubjectquestion(id){
				let ids=[id]
				this.delectsubject(ids)
			},
			// 获取主观题详情
			subjectDetail(id){
				get('/subjective/details',{subjectiveId:id})
				.then(res=>{
					//console.info(res)
					if(res.code==200){
						this.editsubjectquestionlist = res.data
					}else{
						this.$message({
							type: 'error',
							message: res.message
						});
					}
				})
				.catch(error=>{
					this.$message({
						type: 'error',
						message: error.message
					});
				})
			},
			// 编辑主观题
			editsubjectquestion(id){
				this.subjectDetail(id)
				this.questionclassify()
				this.editsubquestionIshow=true
			},
			 parseNumber(value, defaultValue = 0) {
			        const num = parseFloat(value);
			        return isNaN(num) ? defaultValue : num;
			    },
			//保存主观题编辑
			editquestionsurebc(){
				this.editsubquestionIshow=false
				if (!this.editsubjectquestionlist) return null;
					const data = this.editsubjectquestionlist
					const simplifiedData = {
						id: parseInt(data.id, 10),
						examCourseId: parseInt(data.examCourseId, 10),
						questionNumber: parseInt(data.questionNumber, 10),
						fullMarks: parseFloat(data.fullMarks, 10),
						stepSize:parseFloat(data.stepSize, 10),
						reviewCount: parseInt(data.reviewCount, 10),
						reviewThreshold: this.parseNumber(data.reviewThreshold),
						questionRuleId: this.parseNumber(data.questionRuleId),
						finalScoring: Boolean(data.finalScoring)
					};
					if (Array.isArray(data.subjectiveItems)) {
						simplifiedData.subjectiveItems = data.subjectiveItems.map(item => ({
							id:parseInt(item.id, 10),
							subjectiveId:0,
							questionNumber:parseInt(item.questionNumber, 10),
							fullMarks: parseFloat(item.fullMarks, 10),
							stepSize:  parseFloat(item.stepSize, 10),
							reviewCount: parseInt(item.reviewCount, 10),
							reviewThreshold: parseFloat(item.reviewThreshold, 10),
							finalScoring: Boolean(item.finalScoring)
						}));
					}
			//console.info(simplifiedData)
				// return false
// 				const newobj = this.editsubjectquestionlist.subjectiveItems
// .map(item => ({
// 				  ...item,
// 				  examCourseId:Number(this.examinfo.id),
// 				  questionStartNumber: parseInt(item.questionStartNumber, 10),
// 				  questionEndNumber: parseInt(item.questionEndNumber, 10),
// 				  fullMarks: parseInt(item.fullMarks, 10),
// 				  reviewCount:parseInt(item.reviewCount, 10),
// 				  reviewThreshold:parseInt(item.reviewThreshold, 10),
// 				  stepSize:parseInt(item.stepSize, 10),
// 				  questionNumber:0,
// 				  subjectiveItems: Array.isArray(item.subjectiveItems) 
// 										   ? item.subjectiveItems.map(subItem => this.transformSubjectiveItem(subItem))
// 										   : []
// 				}));
				// let newobj = {
				// 	...this.editsubjectquestionlist,
				// 	smallQuestionNumber:undefined,
				// 	smallQuestionScore:undefined
				// }
				post('/subjective/update',simplifiedData)
				.then(res=>{
					this.objquestiontablist()
				})
				.catch(error=>{
					
				})
			},
			//取消主观题编辑
			editquestiongoback(){
				this.editsubquestionIshow=false
			},
			//编辑新增小题
			addsmallquestion1(index){
				let smallquestion = {
				       finalScoring:false,
				       fullMarks:'',
				       id:0,
				       questionNumber:'',
				       reviewCount:'',
				       reviewThreshold:'',
				       stepSize:'',
				       subjectiveId:this.editsubjectquestionlist.id
				}
				this.editsubjectquestionlist.subjectiveItems.push(smallquestion)
			},
			deletesubjectaddnew(index){
				if(index==0){
					this.subquestionlist=[
					  {
					    id: 0,
					    questionNumber: '',
					    fullMarks: '',
					    stepSize:'',
					    reviewCount: '',
					    reviewThreshold: '',
					    finalScoring: true,
					    questionRuleId:null,
					    subjectiveItems: []
					  } 
					]
				}else{
					this.subquestionlist.splice(index, 1);
				}
			},
			deletesubjectaddnewsmall(itemIndex, subIndex){
				this.subquestionlist[itemIndex].subjectiveItems.splice(subIndex, 1);
			}
		},
		components:{navTop,copyExam,empty},
		computed: {
		    objtotalScore() {
		      return this.objective.reduce((accumulator, currentValue) => {
		        return accumulator + currentValue.fullMarks;
		      }, 0);
		    },
			subtotalScore(){
				return this.newsubjectives.reduce((accumulator, currentValue) => {
				  return accumulator + currentValue.fullMarks;
				}, 0);
			},
			// 附加题
			fjttotalScore() {
			  return this.newsubjectives.reduce((accumulator, currentValue) => {
			    // 只有当名称为 "附加题" 时才累加分数
			      if (currentValue.questionRules && currentValue.questionRules.name === '附加题') {
					 return accumulator + currentValue.fullMarks;
				 }
			    // 否则，只返回累加器的当前值
			    return accumulator;
			  }, 0);
			}
		  },
		  beforeDestroy() {
		      // 确保组件销毁时重置所有状态
		      this.isSubmitting = false;
		      this.submitLock = false;
		  }
	}
</script>

<style scoped>
	.main{
		width:100vw;
		height:100vh;
		background: #F4F7FD;;
		overflow-x:hidden;
		overflow-y: auto;
	}
	
	.contentMain{
		width:auto;padding:0 40px;
		margin:0 auto;
		padding-bottom:70px;
	}
	.breadBox{
		height:32px;
		background: #fff;
		line-height: 32px;
		margin-top:2px
	}
	.el-breadcrumb{
		width:auto;padding:0 40px;
		margin:0 auto;
		line-height:30px;
		font-size:14px;
	}
	.el-breadcrumb__inner a, .el-breadcrumb__inner.is-link{
		color:#B3B8C2
	}
	.searchlist{
		box-sizing: border-box;
		width:auto;padding:0 40px;
		display: flex;
		justify-content: space-between;
		height: 54px;
		background: #FFFFFF;
		border-radius: 10px;
		padding:0 24px;
		align-items: center;
		margin-top:14px;
	}
	.searchlist{
		padding-left:20px;
		display: flex;
		align-items: center;
		justify-content: left;
	}
	.searchlist a{
		display: block;
		color:#557292;
		font-size:14px;
		width:100px;
		text-align: center;
		position: relative;
		line-height:52px;
	}
	.searchlist a:hover,.searchlist a.hover{
		color:#295CFF;
	}
	.searchlist a:hover::after,.searchlist a.hover::after{
		content:'';
		width: 24px;
		height: 4px;
		background: #295CFF;
		border-radius: 2px;
		position: absolute;
		left:50%;
		transform: translateX(-50%);
		bottom:0;
	}
	.searchlist ul{
		display: flex;
		align-items: center;
	}
	.searchlist ul li{
		color:#557292;
		font-size:14px;
		width:100px;
		text-align: center;
		position: relative;
		line-height:52px;
		cursor: pointer;
	}
	.searchlist ul li:hover,.searchlist ul li.hover{
		color:#295CFF;
	}
	.searchlist ul li:hover::after,.searchlist ul li.hover::after{
		content:'';
		width: 24px;
		height: 4px;
		background: #295CFF;
		border-radius: 2px;
		position: absolute;
		left:50%;
		transform: translateX(-50%);
		bottom:0;
	}
	.overviewcontent{
		background: #FFFFFF;
		box-shadow: 0px 4px 16px 0px rgba(85,114,146,0.1);
		border-radius: 10px;
		width:auto;padding:0 40px;
		margin:20px auto;
	}
	.examInfo{
		display: flex;
		align-items: center;
	}
	.examInfo b{
		font-weight: normal;
		font-size:14px;
		color:#333;
		position: relative;
		padding-right:14px;
		margin-right:14px;
	}
	.examInfo b i{
		font-style:normal;
		color:#8E96A4
	}
	.examInfo b::after{
		content:'';
		width: 1px;
		height: 8px;
		background:#DEE1E7;
		position:absolute;
		right:0;
		top:50%;
		transform: translateY(-50%);
	}
	.examInfo b:last-child::after{
		content:'';
		width: 1px;
		height: 8px;
		background:#fff;
		position:absolute;
		right:0;
		top:50%;
		transform: translateY(-50%);
	}
	.overvcontentTop{
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding:24px;
	}
	.overvcontentTop h3{
		font-size:18px;
		font-weight:500;
		padding-bottom:15px;
	}
	.overvcontentTop span{
		width: 124px;
		height: 34px;
		background: #295CFF;
		border-radius: 10px;
		font-size: 14px;
		color: #FFFFFF;
		text-align: center;
		line-height:34px;
		cursor: pointer;
	}
	.tableContent{
		padding:0 24px 30px;
		border-radius: 10px;
	}
	.examfooter{
		width:100%;
		height:54px;
		background: rgba(255,255,255,0.6);
		box-shadow: 0px 4px 16px 0px rgba(85,114,146,0.1);
		position:fixed;
		left:0;
		bottom:0;
		z-index:100
	}
	.examFootercontent{
		width:auto;padding:0 40px;
		margin:0 auto;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.examFootercontent .totaldata{
		font-size:14px;
		color:#557292;
		display: flex;
		justify-content: left;
		align-items: center;
	}
	.examFootercontent .totaldata i{
		display: inline-block;
		color:#295CFF;
		font-style: normal;
		line-height:54px;
		padding:0 3px;
	}
	.examFootercontent .totaldata em{
		font-style:normal;
		width: 96px;
		height: 34px;
		border-radius: 10px;
		line-height:34px;
		background: #295CFF;
		text-align: center;
		color:#fff;
		margin-left:14px;
		cursor: pointer;
	}
	.examFootercontent .totaldata em:last-child{
		background:#EC555A;
	}
	.examFootercontent .totaldata >>> .el-pager li.active{
		background-color:#295CFF
	}
	.scorered{
		font-size:14px;
		color:#EC555A;
		padding:24px 0;
	}
	.custom-table {
	  width: 100%;
	  border: 1px solid rgba(216,228,240,0.34);
	  border-radius:10px;
	  border-right: none;
	  border-bottom:none;
	}
	
	/* 自定义表格内部元素的样式 */
	.custom-table >>> .el-table__header-wrapper th {
	  background-color: #E8F0FA;
	  height:42px;
	  padding:0;
	  text-align: center;
	  font-weight:normal
	}
	.custom-table >>> .el-table__row td {
	  height:42px;
	  padding:0;
	  text-align: center;
	  border-bottom:none;
	  border-right:solid 1px rgba(216,228,240,0.34);
	  font-size:14px;
	}
	.el-table .warning-row {
	    background: #ffffff;
	 }
	.el-table .success-row {
	    background: #D8E4F0;
	}
	.answerlist{
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.answerlist li{
		width: 30px;
		height: 22px;
		font-size:14px;
		text-align: center;
		line-height:22px;
		border-radius: 6px;
		margin:0 5px;
	}
	.answerlist li:nth-child(1){
		background: rgba(101,157,113,0.06);
		border: 1px solid rgba(101,157,113,0.5);
		color:#659D71
	}
	.answerlist li:nth-child(2){
		background: rgba(49,121,190,0.06);
		border: 1px solid rgba(49,121,190,0.5);
		color:#3179BE
	}
	.answerlist li:nth-child(3){
		background: rgba(84,62,164,0.06);
		border: 1px solid rgba(84,62,164,0.5);
		color:#543EA4
	}
	.answerlist li:nth-child(4){
		background: rgba(101,157,113,0.06);
		border: 1px solid rgba(101,120,157,0.5);
		color:#65789D
	}
	.examFootercontent >>> .el-pagination__jump{
		margin-left:5px;
	}
	.examFootercontent >>> .el-pager{
		margin-top:2px;
	}
	.examFootercontent >>> .el-pager li{
		margin:0 3px;
		min-width:25px;
		height: 25px;
		line-height: 25px
	}
	.examFootercontent >>> .el-pagination button{
		height:25px;
		line-height:25px;
		margin-top:2px;
	}
	.objsubMain{
		position:fixed;
		left:0;
		top:0;
		width:100%;
		height:100%;
		background:rgba(0,0,0,0.75);
		z-index:100;
	}
	.objsubContent{
		box-sizing: border-box;
		width: 1040px;
		max-height: 600px;
		background: #FFFFFF;
		box-shadow: 0px 4px 16px 0px rgba(85,114,146,0.1);
		border-radius: 10px;
		position: fixed;
		left:50%;
		top:50%;
		transform: translate(-50%,-50%);
		padding:24px;
	}
	.objsubContent h3{
		font-size:18px;
		font-weight: normal;
	}
	.objsubattention{
		display: flex;
		font-size:14px;
		color:#619CF5;
		padding:10px 0 24px;
	}
	.gundongtiaotable{
		width:100%;
		height:360px;
		overflow-y: auto;
		overflow-x: hidden;
	}
	.gundongtiaotable::-webkit-scrollbar {
		width:6px;
		background-color: #eee;
		border-radius:10px;
	}
	.gundongtiaotable::-webkit-scrollbar-track {
		background-color: #eee;
		border-radius:10px;
	}
	.gundongtiaotable::-webkit-scrollbar-thumb {
		background: #619CF5;
		border-radius: 10px;
	}
	.fxwidth{
		font-size:14px;
		color:#2A303B;
	}
	.fxwidth >>> .el-input__inner{
		width: 35px;
		height: 30px;
		background: #F2F6FB;
		border-radius: 10px;
		border: 1px solid #D8E4F0;
		padding:0;
		text-align: center;
	}
	.answerwidth >>> .el-input__inner{
		width: 156px;
		height: 30px;
		background: #F2F6FB;
		border-radius: 10px;
		border: 1px solid #D8E4F0;
		padding:0 10px
	}
	.selectbox >>> .el-input__inner{
		width: 86px;
		height: 30px;
		/* background: #F2F6FB; */
		border-radius: 10px;
		border: 1px solid #D8E4F0;
		color:#2A303B;
		padding:0 8px;
	}
	.selectbox >>> .el-input__icon{
		line-height:30px;
	}
	.exambutton{
		display: flex;
		align-items: center;
		margin-top:24px;
	}
	.exambutton span{
		width: 124px;
		height: 34px;
		border-radius: 10px;
		font-size: 14px;
		text-align: center;
		line-height:34px;
		cursor: pointer;
	}
	.exambutton span:first-child{
		background: #295CFF;
		color:#fff;
		margin-right:24px;
	}
	.exambutton span:last-child{
		background: #F2F6FB;
		border: 1px solid #295CFF;
		color:#295CFF;
	}
	.input-error >>> .el-input__inner{
		border:#EC555A solid 1px;
	}
	
	.objsubContent table{
		border-radius: 10px;
		border: 1px solid rgba(216,228,240,0.5);
	}
	.objsubContent table tr th{
		font-size:14px;
		font-weight:normal;
		background:#E8F0FA;
		height:42px;
	}
	.objsubContent table tr th:first-child{
		border-radius: 8px 0 0 0;
	}
	.objsubContent table tr th:last-child{
		border-radius: 0 8px 0 0;
	}
	.objsubContent table tr td{
		height:42px;
		text-align: center;
		font-size:14px;
		border-right:solid 1px rgba(216,228,240,0.34);
	}
	.objsubContent table tr td:last-child{
		border-right:none;
	}
	.objsubContent table tr td i{
		display: block;
		font-style: normal;
		font-size:12px;
		color:#999
	}
	.objsubContent table tr td em{
		display: block;
	}
	.objsubContent table tr td span{
		position:relative;
		display: inline-block;
		cursor: pointer;
	}
	.objsubContent table tr td span em{
		font-size:12px;
		font-style:normal;
	}
	.objsubContent table tr td span::after{
		content:'';
		width: 43px;
		height: 1px;
		position:absolute;
		left:50%;
		bottom:-4px;
		transform: translateX(-50%);
		background:#000;
	}
	.objsubContent table tr td span.green{
		color:#288F41
	}
	.objsubContent table tr td span.green::after{
		content:'';
		width: 43px;
		height: 1px;
		position:absolute;
		left:50%;
		bottom:-4px;
		transform: translateX(-50%);
		background:#288F41;
	}
	.objsubContent table tr td span.blue{
		color:#295CFF
	}
	.objsubContent table tr td span.blue::after{
		content:'';
		width: 43px;
		height: 1px;
		position:absolute;
		left:50%;
		bottom:-4px;
		transform: translateX(-50%);
		background:#295CFF;
	}
	.objsubContent table tr td span.red{
		color:#EC555A
	}
	.objsubContent table tr td span.red::after{
		content:'';
		width: 43px;
		height: 1px;
		position:absolute;
		left:50%;
		bottom:-4px;
		transform: translateX(-50%);
		background:#EC555A;
	}
	.objsubContent table tr td span.gray{
		color:#D8E4F0
	}
	.objsubContent table tr td span.gray::after{
		content:'';
		width: 43px;
		height: 1px;
		position:absolute;
		left:50%;
		bottom:-4px;
		transform: translateX(-50%);
		background:#D8E4F0;
	}
	.objsubContent table tr:nth-child(3n){
		background:#FAFAFB
	}
	
	
	
	.addExamMain{
		position: fixed;
		width:100%;
		height:100%;
		background:rgba(0,0,0,0.5);
		left:0;
		top:0;
		z-index:5;
	}
	.addExamContent{
		width: 584px;
		height: auto;
		background: #FFFFFF;
		box-shadow: 0px 4px 16px 0px rgba(85,114,146,0.1);
		border-radius: 10px;
		position: fixed;
		left:50%;
		top:50%;
		transform: translate(-50%,-50%);
		z-index:2;
		box-sizing: border-box;
		padding:30px;
	}
	.addExamContent h3{
		font-size:18px;
		padding-bottom:20px;
	}
	.addExamContent ul.muchcommentlist li{
		display: flex;
		align-items: center;
		padding-bottom:14px;
		font-size:14px;
	}
	.addExamContent ul.muchcommentlist li span{
		font-size:14px;
		width:98px;
		color: #557292;
		text-align: right;
	}
	.addExamContent ul.muchcommentlist li p{
		position: relative;
	}
	.addExamContent ul.muchcommentlist li p em{
		position: absolute;
		right:10px;
		top:50%;
		transform: translateY(-50%);
		color:#C0C4CC;
		cursor: pointer;
	}
	.addExamContent ul.muchcommentlist li >>>.el-input__inner{
		width: 400px;
		height: 34px;
		border-radius: 10px;
		border: 1px solid #D8E4F0;
	}
	.inputBox{
		width: 400px;
	}
	.inputBox1{
		width: 300px;
	}
	.addExamContent ul.muchcommentlist li div.inputBox1 >>> .el-input__inner{
		width:300px;
		height: 34px;
		border-radius: 10px;
		border: 1px solid #D8E4F0;
	}
	.addExamContent ul.muchcommentlist li >>> .el-range__icon{
		line-height:27px;
	}
	.groupbutton{
		display: flex;
		align-items: center;
		padding-top:20px;
	}
	.groupbutton >>> .el-button{
		width: 124px;
		height: 34px;
		background: #295CFF;
		border-radius: 10px;
		font-size: 14px;
		color: #FFFFFF;
		padding:0;
	}
	.groupbutton >>> .el-button:last-child{
		background: #F2F6FB;
		border-radius: 10px;
		border: 1px solid #295CFF;
		color:#295CFF;
		margin-left:24px;
	}
	.bcontentcolor{
		font-size:14px;
		color:#295CFF;
		display: inline-block;
		margin-left:20px;
		cursor: pointer;
	}
	.el-checkbox{
		margin-right:8px;
	}
	.infosetcontentfont{
		color:#5B6371
	}
	.addExamContent ul.muchcommentlist li.infosetcontentfont span{
		width:auto;
		height: 26px;
		border-radius: 4px;
		border: 1px solid #D8E4F0;
		color:#B3B8C2;
		font-size:14px;
		text-align:left;
		line-height:26px;
		padding:0 16px 0 10px;
		margin-left:10px;
	}
	.addExamContent ul.muchcommentlist li.infosetcontentfont i{
		font-style:normal;
		color:#295CFF;
		padding:0 4px;
	}
	.tabletabcopy{
		display: flex;
		align-items: center;
		width: 252px;
		height: 30px;
		background: rgba(41,92,255,0.06);
		border-radius: 4px;
		border: 1px solid #295CFF;
	}
	.tabletabcopy li{
		width:84px;
		border-right:solid 1px #295CFF;
		line-height:30px;
		font-size:14px;
		color:#295CFF;
		text-align: center; 
		cursor: pointer;
	}
	.tabletabcopy li:last-child{
		border-right:none;
	}
	.tabletabcopy li.hover,.tabletabcopy li:hover{
		background:#295CFF;
		color:#fff;
	}
	.copyexamcontent{
		height:300px;
		overflow-y: auto;
		overflow-x: hidden;
	}
	.copyexamcontent::-webkit-scrollbar {
		 width:4px;
		background-color: #eee;
		border-radius:10px;
	}
	.copyexamcontent::-webkit-scrollbar-track {
		background-color: #eee;
		border-radius:10px;
	}
	.copyexamcontent::-webkit-scrollbar-thumb {
		background: #619CF5;
		border-radius: 10px;
	}
	.copyexamcontent ul{
		
	}
	.copyexamcontent ul li{
		padding:24px 0;
		border-bottom:solid 1px #EFF1F4;
		cursor: pointer;
	}
	.copyexamcontent ul li div{
		font-size:16px;
		color:#2A303B;
	}
	.copyexamcontent ul li div span{
		color:#557292;
		font-size:12px;
		padding-left:8px;
	}
	.copyexamcontent ul li p{
		font-size:14px;
		color:#295CFF;
		padding-top:10px;
	}
	.copyexamcontent ul li p em{
		font-style: normal;
		margin-right:10px;
	}
	.addExamContent >>> .el-upload-dragger{
		width:522px;
	}
	.uploadbox{
		width:522px;
		height:220px;
		position:relative;
	}
	.uploadbox a{
		position:absolute;
		right:0;
		bottom:10px;
		font-size:14px;
		color:#295CFF;
	}
	.tablebox{
		width:100%;
		background: #FFFFFF;
		box-shadow: 0px 4px 16px 0px rgba(85,114,146,0.1);
		border-radius: 10px;
	}
	.tableboxtitle{
		display: flex;
		align-items: center;
		height:42px;
		background:#E8F0FA;
		border-radius:10px 10px 0 0;
	}
	.tableboxtitle li{
		line-height:42px;
		text-align:center;
		font-size:14px;
		color:#2A303B;
		border-right: 1px solid rgba(216,228,240,0.34);
	}
	.tableboxtitle li:first-child{
		border-radius: 10px 0 0 0;
	}
	.tableboxtitle li:last-child{
		border-radius: 0 10px 0 0;
		border-right: none
	}
	.tableboxcontent{
		width:100%;
	}
	.tableboxcontent li:nth-child(2n){
		background: #FAFAFB;
	}
	.bigquestion{
		display: flex;
		align-items: center;
	}
	.tabletrtd{
		display:flex;
		align-items: center;
		justify-content: center;
		text-align: center;
		height:42px;
		border-right:1px solid rgba(216,228,240,0.34)
	}
	.bigquestion div.tabletrtd:last-child{
		border-right: none
	}
	.addExamContent ul.muchcommentlist li .classobxst >>> .el-input__inner{
		width:150px;
	}
	.yes{
		cursor: pointer;display: inline-block;width: 43px;height: 30px;border-radius:10px;background:#EDF4F0;border:solid 1px #53A667;font-size:14px;
		color:#53A667;font-style:normal;line-height:30px;
	}
	.no{
		cursor: pointer;display: inline-block;width: 43px;height: 30px;border-radius:10px;background:#FEF5F5;border:solid 1px #EC555A;font-size:14px;
		color:#EC555A;font-style:normal;line-height:30px;
	}
	.boxsetscorll{
		height:390px;
		overflow-x: hidden;
		overflow-y: auto;
	}
	.boxsetscorll::-webkit-scrollbar {
		 width:6px;
		background-color: #eee;
		border-radius:10px;
	}
	.boxsetscorll::-webkit-scrollbar-track {
		background-color: #eee;
		border-radius:10px;
	}
	.boxsetscorll::-webkit-scrollbar-thumb {
		background: #619CF5;
		border-radius: 10px;
	} 
	.breadBox >>> .el-breadcrumb__inner a,.breadBox >>> .el-breadcrumb__inner.is-link{
		font-weight:normal
	}
	.breadBox >>> .el-breadcrumb__item:last-child .el-breadcrumb__inner,
	.breadBox >>> .el-breadcrumb__item:last-child .el-breadcrumb__inner a,
	.breadBox >>> .el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,
	.breadBox >>> .el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{
		font-weight:bold
	}	
</style>